<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Demo</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="stylesheet" href="zico/css/zico.css">
    <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
    <script src="jquery/jquery.js"></script>
    <script src="popper/umd/popper.js"></script>
    <script src="bootstrap/js/bootstrap.js"></script>

    <link rel="stylesheet" href="css/demo.css">
    <script>
        window.onload = function () {
            var closable = window.localStorage.getItem("closable");
            if(closable === "true"){
                window.close();
                window.localStorage.removeItem("closable");
            }
        }
    </script>
</head>
<body>
<div th:insert="~{navigation :: nav}"></div>
<main class="container">
    <div class="container-fluid p-5 rounded">
        <div class="row">
            <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
                <h2><i class="zi zi_list"></i></span>  发现</h2>
                <hr>
                <div class="media my-3" th:each="question : ${pagination.data}">
                    <div class="media-left mr-3">
                        <a href="#">
                            <img th:src="${question.user.getAvatarUrl()}" alt="头像" class="img-thumbnail">
                        </a>
                    </div>
                    <div class="media-body">
                        <h4 class="media-heading">
                            <a th:href="@{'question/' + ${question.id}}" th:text="${question.title}"></a>
                        </h4>
                        <span th:text="${question.description}"></span> <br>
                        <span class="text-desc"><span th:text="${question.getCommentCount()}"></span>回复 · <span th:text="${question.getLikeCount()}"></span>点赞 · <span th:text="${question.getViewCount()}"></span>浏览 · <span th:text="${#dates.format(question.getGmtCreate(), 'yyyy-MM-dd HH:mm')}"></span></span>
                    </div>
                </div>
                <ul class="pagination float-right">
                    <li class="page-item" th:if="${pagination.showFirstPage}">
                        <a class="page-link" href="/?page=1" aria-label="First">
                            <span aria-hidden="true">&lt;&lt;</span>
                            <span class="sr-only">First</span>
                        </a>
                    </li>
                    <li class="page-item" th:if="${pagination.showPrevious}">
                        <a class="page-link" th:href="@{/(page=${pagination.page - 1})}" aria-label="Previous">
                            <span aria-hidden="true">&lt;</span>
                            <span class="sr-only">Previous</span>
                        </a>
                    </li>
                    <li th:each="page : ${pagination.pages}" class="page-item" th:class="${pagination.page == page} ? 'page-item active' : 'page-item'"><a class="page-link" th:text="${page}" th:href="@{/(page=${page})}"></a></li>
                    <li class="page-item" th:if="${pagination.showNext}">
                        <a class="page-link" th:href="@{/(page=${pagination.page + 1})}" aria-label="Next">
                            <span aria-hidden="true">&gt;</span>
                            <span class="sr-only">Next</span>
                        </a>
                    </li>
                    <li class="page-item" th:if="${pagination.showEndPage}">
                        <a class="page-link" th:href="@{/(page=${pagination.totalPage})}" aria-label="Next">
                            <span aria-hidden="true">&gt;&gt;</span>
                            <span class="sr-only">End</span>
                        </a>
                    </li>
                </ul>
            </div>
            <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
                <h3>热门话题</h3>
                <ul>
                    <li>问题标题: 请用精简的语言描述您发布的问题，不超过25字</li>
                    <li>问题补充: 详细补充您的问题内容，并确保问题描述清晰直观, 并提供一些相关的资料：</li>
                    <li>选择标签: 选择一个或者多个合适的标签，不超过10个字</li>
                </ul>
            </div>
        </div>
    </div>
</main>
</body>
</html>